cmake_minimum_required(VERSION 3.10)

# Remove when sharing with others.
list(APPEND CMAKE_PREFIX_PATH "C:/Qt/Tools/QtCreator")

project(qtc_cppcheck)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_STANDARD 17)

find_package(QtCreator REQUIRED COMPONENTS Core)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
set(QtX Qt${QT_VERSION_MAJOR})

add_qtc_plugin(qtc_cppcheck
  PLUGIN_DEPENDS
    QtCreator::Core
    QtCreator::QtSupport
    QtCreator::TextEditor
    QtCreator::DiffEditor
    QtCreator::ProjectExplorer
    QtCreator::QmakeProjectManager
  DEPENDS
    ${QtX}::Widgets
    QtCreator::ExtensionSystem
    QtCreator::Utils
  SOURCES
    qtc_cppcheck.cpp
    qtc_cppcheck.h
    qtc_cppcheckconstants.h
    cdlgcheckproject.h
    cdlgcheckproject.cpp
    cdlgcheckproject.ui
    qtc_cppcheck.qrc
    csettings.cpp
    csettings.h
    optionpage.cpp
    optionpage.h
    optionwidget.cpp
    optionwidget.h
    optionwidget.ui
    worker_check.cpp
    worker_check.h
)
